using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

public class DialogBase : MonoBehaviour
{
    protected Animator animator;
    
    /*private void Start()
    {
        animator = GetComponent<Animator>();
    }*/

    public virtual void Open()
    {
        animator = GetComponent<Animator>();
        this.gameObject.SetActive(true);
    }

    public void Close()
    {
        animator.SetTrigger("Close");
        StartCoroutine(HideDialog());
    }

    private IEnumerator HideDialog()
    {
        yield return new WaitForSecondsRealtime(0.5f);
        this.gameObject.SetActive(false);
    }
}
